﻿using System;
using System.Collections.Generic;
using System.Windows.Controls;
using Soapi.Domain;

namespace Soapi.Notify2
{
    [Serializable]
    public class SiteListItem //: INotifyPropertyChanged
    {
        private string _apiEndpoint = string.Empty;
        private bool _enabled;
        private string _excludedTags = string.Empty;
        private string _includedTags = string.Empty;
        private string _name = string.Empty;
        private string _pinnedTags = string.Empty;
        [field: NonSerialized]
        private Site _site;
        private List<QuestionInfo> _watchedQuestions = new List<QuestionInfo>();
        [field: NonSerialized]
        private Image _siteIcon;
        private DateTime _lastProcessTime;
        public DateTime LastProcessTime
        {
            get
            {
                return _lastProcessTime;
            }
            set
            {
                _lastProcessTime = value;
            }
        }
        public Image SiteIcon
        {
            get
            {
                return _siteIcon;
            }
            set
            {
                _siteIcon = value;
            }
        }
        public SiteListItem(string name, string apiEndpoint, bool enabled)
        {
            _name = name;
            _apiEndpoint = apiEndpoint;
            _enabled = enabled;
        }

        public string IncludedTags
        {
            get { return _includedTags; }
            set { _includedTags = value; }
        }

        public string ExcludedTags
        {
            get { return _excludedTags; }
            set { _excludedTags = value; }
        }

        public string PinnedTags
        {
            get { return _pinnedTags; }
            set { _pinnedTags = value; }
        }

        public List<QuestionInfo> WatchedQuestions
        {
            get { return _watchedQuestions; }
            set { _watchedQuestions = value; }
        }

        public Site Site
        {
            get { return _site; }
            set { _site = value; }
        }

        public string ApiEndpoint
        {
            get { return _apiEndpoint; }
            set { _apiEndpoint = value; }
        }


        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        public bool Enabled
        {
            get { return _enabled; }
            set
            {
                _enabled = value;
            }
        }

        #region INotifyPropertyChanged Members

        //public event PropertyChangedEventHandler PropertyChanged;

        #endregion

        //public void OnPropertyChanged(string prop)
        //{
        //    var e = new PropertyChangedEventArgs(prop);
        //    PropertyChangedEventHandler handler = PropertyChanged;
        //    if (handler != null) handler(this, e);
        //}
    }
}